﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.FXModel
{
    public partial class SAreaManagerAgentDetail : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "SAreaManagerMasterList";
            }
        }
        #region 属性 (查询条件)




        protected int UserID
        {
            get
            {
                return GetRequestValue<int>("UserID", 0);
            }
        }


        protected override string orderField
        {
            get
            {
                return string.IsNullOrEmpty(base.orderField) ? "ParFolderID" : base.orderField;
            }
        }
        protected override string orderDirection
        {
            get
            {
                return string.IsNullOrEmpty(base.orderDirection) ? "Desc" : base.orderDirection;
            }
        }


        #endregion

        protected string GetRealName(object _ParFolderID)
        {
            int parFolderID = Convert.ToInt32(_ParFolderID);
            OUserInfo obj = OUserController.GetById(parFolderID);
            if (obj == null)
                return "";//"<B STYLE='COLOR:RED'>未分配</B>";
            else
                return obj.RealName;

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
            this.AddLog(Permission.查看,"");
        }

        protected void DataBind()
        {

            this.rpMenu.DataSource = SAreaManagerAgentController.GetAllByUserId(UserID); 
            this.rpMenu.DataBind();
        }
       
    }
}